<template>
  <el-card>
    <template #header>
      <div>debounceWait【useRequest】</div>
    </template>
    <div>
      <div style="margin-top: 16px">
        <el-input type="text" v-model="text" />
      </div>
      <div style="margin-top: 16px">
        value：{{ data?.data?.result?.userInfo?.username }}
      </div>
    </div>
  </el-card>
</template>

<script setup>
  import { useRequest } from "vue-hooks-plus";
  import { testsapi } from "/@/api/index";

  const text = ref("");

  const { data, run } = useRequest(() => testsapi.GetUserInfo(), {
    debounceWait: 1000 * 4,
    manual: true,
  });

  watch(text, async (c) => {
    await run();
  });
</script>

<style lang="scss" scoped></style>
